<template>
  <el-dialog :visible.sync="dialogVisible" width="800px" :before-close="handleClose" :close-on-click-modal="false"
  :loading="loading"
    append-to-body :title="title">
    <el-table :data="tableData"  border style="width: 100%">
    <el-table-column prop="name" label="医生" width="180"></el-table-column>
    <el-table-column prop="code" label="工号" width="180"></el-table-column>
    <el-table-column prop="order_count" label="接诊数量" ></el-table-column>
    <el-table-column prop="advice_count" label="开发数量" ></el-table-column>
    <el-table-column prop="review_count" label="审方数量"></el-table-column>
  </el-table>
    <div slot="footer" class="tx-c">
      <el-button type="primary" @click="handleClose" >确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { ApidataStatisticsDoctor } from "@/api/index.js";

export default {
  components: {
  },
  data() {
    return {
      dialogVisible: false,
      title: '',
      loading: false,
      param:{},
      tableData: []
    };
  },

  methods: {
    show(row, param) {
      this.title = row.name
      this.dialogVisible = true
      this.loading = true
      this.param = param
      this.param.department_id = row.id
      ApidataStatisticsDoctor(this.param).then(res => {
        this.tableData = res.data
      }).finally(_=> {
        this.loading = false
      })
    },

    handleClose() {
      this.dialogVisible = false
    },
  },
};
</script>

<style>
.el-dialog {
  width: 80vh;
}
</style>
